package com.usian.mapper;

import com.usian.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface RoleMapper {

    @Select("select * from user where name=#{name} and pas = #{pas}")
    User findUser(User user);

    @Select("select rold from role where id = (select rid from user where id = #{id})")
    String findRidByUid(Integer id);
    @Insert("INSERT INTO user(id, name, pas, date, rid) VALUES (#{id}, #{name}, #{pas}, #{date}, #{rid})")
    void add(User user);
}
